<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" 
      xmlns:sec="http://www.pollix.at/thymeleaf/shiro">
<head th:replace="admin/common/html/head :: head_Normal(~{::title},~{::link},~{::style})">

<title th:text=${title}></title>
<!-- 这儿引用单独的css link -->
<!-- Ladda for Bootstrap 3按钮加载进度插件 -->
<link rel="stylesheet" th:href="@{/static/admin/assets/js/button/ladda/ladda.min.css}">
<!-- bootstrap-table表单样式 -->
<link th:href="@{/static/admin/assets/js/bootstrap/css/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>
    <link th:href="@{/static/admin/assets/js/select2/css/select2.min.css}" rel="stylesheet"/>

    <style type="text/css">
        .control-label {
            margin-top: 10px;
        }

        .row {
            margin: 0%;
        }
    </style>

</head>

<body id="listbody">
<!-- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 代码编写处 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -->

<!-- 右边内容 -->
<div class="wrap-fluid">
    <div class="container-fluid paper-wrap bevel tlbr">
        <!-- 内容 -->
        <!--标题 通用-->
        <div th:replace="admin/common/html/title :: title(${title},${parenttitle},${isMsg},${msgHTML})">
        </div>
        <!-- 结束标题 通用-->
        <div class="content-wrap">
            <!-- 结束内容 -->
            <div class="row">
                <div class="col-sm-12">
                <!-- 搜索条件 -->
                
                	 <div class="nest" id="inlineClose">
                            <div class="title-alt">
                                <h6>搜索条件</h6>
                                <div class="titleClose">
                                    <a class="gone" href="#inlineClose">
                                        <span class="entypo-cancel"></span>
                                    </a>
                                </div>
                                <div class="titleToggle">
                                    <a class="nav-toggle-alt" href="#search_div" >
                                        <span class="entypo-down-open"></span>
                                    </a>
                                </div>
                            </div>

                         <div class="body-flow" id="search_div" style="display: block">
                             <div class="form_left">
                                 <form role="form" class="form-group-md" id="form-search">
                                     <div class="row">
                                         <div class="col-md-4 col-sm-3">
                                             <div class="form-group">
                                                 <label class="col-sm-4 control-label ">年级：</label>
                                                 <div class="col-sm-8">
                                                     <select class="form-control" id="grade-select" name="grade">
                                                         <option value="2017">2017</option>
                                                     </select>
                                                 </div>
                                             </div>
                                         </div>
                                         <div class="col-md-4 col-sm-3">
                                             <div class="form-group">
                                                 <label class="col-sm-4 control-label ">考试科目：</label>
                                                 <div class="col-sm-8">
                                                     <select class="form-control selectpicker" id="course-select"
                                                             name="courseName">
                                                         <option th:each="list : ${courseList}"
                                                                 th:text="${list.courseName}"
                                                                 th:value="${list.courseName}">
                                                         </option>
                                                     </select>
                                                 </div>
                                             </div>
                                         </div>
                                     </div>

                                     <div class="row">
                                         <div class="col-md-4 col-sm-3">
                                             <div class="form-group">
                                                 <label class="col-sm-4 control-label">学院：</label>
                                                 <div class="col-sm-8">
                                                     <select class="form-control" id="college_select" name="cid">
                                                         <option th:each="list : ${collegeList}"
                                                                 th:text="${list.collegeName}"
                                                                 th:value="${list.collegeId}">
                                                         </option>
                                                     </select>
                                                 </div>
                                             </div>
                                         </div>
                                         <div class="col-md-4 col-sm-3">
                                             <div class="form-group">
                                                 <label class="col-sm-4 control-label ">专业：</label>
                                                 <div class="col-sm-8">
                                                     <select class="form-control" id="major_select" name="mid">
                                                     </select>
                                                 </div>
                                             </div>
                                         </div>
                                         <div class="col-md-4 col-sm-3">
                                             <div class="form-group">
                                                 <label class="col-sm-4 control-label ">班级：</label>
                                                 <div class="col-sm-8">
                                                     <select class="form-control" id="clazz_select" name="clid">
                                                     </select>
                                                 </div>
                                             </div>
                                         </div>


                                     </div>
                                     <div class="row">
                                         <div class="col-md-4 col-sm-3">
                                             <div class="form-group">
                                                 <label class="col-sm-4 control-label ">排序：</label>
                                                 <div class="col-sm-8">
                                                     <select class="form-control" id="scoreOder" name="order">
                                                         <option value="ID">默认</option>
                                                         <option value="total ASC">总评成绩：低—>高</option>
                                                         <option value="total DESC">总评成绩：高—>低</option>
                                                         <option value="std ASC">标准分：低—>高</option>
                                                         <option value="std DESC">标准分：高—>低</option>
                                                     </select>
                                                 </div>
                                             </div>
                                         </div>
                                         <div class="col-md-4 col-sm-3">
                                         </div>
                                         <div class="col-md-4 col-sm-3">
                                             <button onclick="$.table.search(this)" class="btn btn-success"
                                                     type="button"><i class="fa fa-search"></i>&nbsp;搜索
                                             </button>
                                         </div>
                                     </div>
                                 </form>
                             </div>
                             <br>
                             <div class="row">
                                 <div class="col-md-12">
                                     <p>
                                         <strong class="control-label">注：</strong>
                                         1.班级的<u>平时成绩</u>，<u>期末成绩</u>以及<u>总评成绩</u>是班级内所有学生对某一科目的<strong>平均成绩</strong>。<br>
                                         &nbsp;&emsp;&emsp;2.班级成绩分级是以<strong>总评成绩</strong>为标准：<span class="small">优秀：90~100，良好：80~90，中等：70~80，及格：60~70，不及格：低于60</span><br>
                                         &nbsp;&emsp;&emsp;3.班级标准分是以<strong>所在专业的平均总评成绩</strong>以及<strong>其标准差</strong>为参考得出。(<span class="small">由于班级参数存在样本过少问题，班级标准分仅供参考</span>)
                                     </p>

                                 </div>
                             </div>


                         </div>
                        </div>
                	<!-- END搜索条件 -->
                    <!-- 空白页开始-->
                    <div class="nest" id="Blank_PageClose">
                        <div class="title-alt">
                            <h6>班级成绩分析概况表</h6>
                            <div class="titleClose">
                                <a class="gone" href="#Blank_PageClose">
                                    <span class="entypo-cancel"></span>
                                </a>
                            </div>
                            <div class="titleToggle">
                                <a class="nav-toggle-alt" href="#Blank_Page_Content">
                                    <span class="entypo-up-open"></span>
                                </a>
                            </div>
                        </div>
                        
                        <div class="body-nest" id="Blank_Page_Content">
                            <!-- 工具条 -->
                            <div class="btn-group hidden-xs" id="exampleTableEventsToolbar" role="group">

                               <button id="refresh" type="button" class="btn btn-success">
                                    <span class="fa fa-list-alt"></span>&nbsp;&nbsp;刷新标准分
                               </button>

                           </div>
                            <!-- 工具条 end-->
                           <table id="dataTable" class="table-striped footable-res footable metro-blue" data-page-size="6">
                                   
                           </table>
                        </div>
                    </div>
                </div>
                <!-- 空白页结束 -->
            </div>
            <!-- 结束内容 -->
        </div>
    </div>
</div>
<!-- 结束右边内容 -->
<!-- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 代码编写处 END# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -->

<!-- 通用js -->
<div th:include="admin/common/html/js :: onload_js">
   
</div>
<!-- bootstarp 表格 -->
<script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/bootstrap-table.min.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/base_list.js}" type="text/javascript"></script>
<!-- jquery-export 表格导出插件 -->
<script th:src="@{/static/admin/assets/js/bootstrap/extensions/export/bootstrap-table-export.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/extensions/export/tableExport.js}" type="text/javascript"></script>

<!-- 弹窗 -->
<script th:src="@{/static/admin/assets/js/layer/layer.js}" type="text/javascript"></script>
<!-- 遮罩层 -->
<script th:src="@{/static/admin/assets/js/blockUI/jquery.blockUI.js}" type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/select2/js/select2.full.min.js}" type="text/javascript"></script>

<script type="text/javascript" th:inline="javascript">
    window.rootPath=[[${#httpServletRequest.getContextPath()}]];
    <!--更新分析表单的方法-->
    $("#refresh").on("click",function () {
        $.ajax({
            type:"get",
            url:rootPath+"/admin/refreshStdClazz",
            success:function (data) {
                if(data.code==200){
                    $.modal.msgSuccess(data.msg)

                }else {
                    $.modal.alertError(data.msg)
                }
            }
        })
    })
</script>



<script>
    //城市查询
    function majorList() {
        $("#major_select").html("");
        $.ajax({
            type: 'get',
            dataType: 'json',
            url: window.rootPath + "/admin/collegeLinked/getMajor?cid=" + $("#college_select").val(),
            success: function (data) {
                for (var i = 0; i < data.length; i++) {
                    $("#major_select").append("<option value='" + data[i].majorId + "'>" + data[i].majorName + "</option>");

                }
                $("#major_select").select2({
                    placeholder: "请选择"
                }).on("change", function (e) {
                    clazzList();
                })

            }
        })
    }

    //区县查询
    function clazzList() {
        $("#clazz_select").html("");
        $.ajax({
            type: 'get',
            dataType: 'json',
            url: window.rootPath + "/admin/collegeLinked/getClazz?mid=" + $("#major_select").val(),
            success: function (data) {
                $("#clazz_select").append("<option value='0'>全部班级</option>");
                for (var i = 0; i < data.length; i++) {
                    $("#clazz_select").append("<option value='" + data[i].clazzId + "'>" + data[i].clazzName + "</option>");
                }
                $("#clazz_select").select2({
                    placeholder: "请选择"
                });
            }
        })
    }

    $(function () {
        $("#college_select").select2({
            placeholder: "请选择"
        }).on("change", function (e) {
            majorList();
        })
        $("#grade-select").select2({
            placeholder: "请选择"
        });
        $("#course-select").select2({
            placeholder: "请选择"
        });
        $("#scoreOder").select2({
            placeholder: "请选择"
        });
    })

</script>


<script type="text/javascript">

      	   	      	      	      	      	      	      	      	      	      	      	      	      	      	      	      	      	      
<!-- 导出 -->
var dataUrl=window.rootPath+"/admin/saClazz/list";
var updateUrl=window.rootPath+"/admin/saClazz/edit/{id}";
var exportUrl=window.rootPath+"/admin/saClazz/export";
  var options = {
		dataUrl: dataUrl,
        updateUrl: updateUrl,
        exportUrl: exportUrl,
        sortName: "roleSort",
        modalName: "班级成绩分析",
        search: false,
	   dataColumns: [
			{
			    field: 'grade',
			    title: '年级'
			},
			{
			    field: 'courseName',
			    title: '课程名字'
			},
			{
			    field: 'clazz',
			    title: '班级'
			},
			{
			    field: 'avgRegularScore',
			    title: '平时成绩'
			},
			{
			    field: 'avgFinalScore',
			    title: '期末成绩'
			},
           {
               field: 'stdFinalScore',
               title: '期末成绩标准差'
           },
			{
			    field: 'avgTotalScore',
			    title: '总评成绩'
			},

           {
               field: 'stdTotalScore',
               title: '总评成绩标准差'
           },
           {
               field: 'stdScore',
               title: '标准分'
           },
			{
			    field: 'sumClazzStu',
			    title: '班级总人数'
			},
			{
			    field: 'sumExcellent',
			    title: '优秀'
			},
			{
			    field: 'sumGood',
			    title: '良好'
			},
			{
			    field: 'sumMedium',
			    title: '中等'
			},
			{
			    field: 'sumPass',
			    title: '及格'
			},
			{
			    field: 'sumFail',
			    title: '不及格'
			},


			{
			    title: '操作',
			    formatter: function (value, row, index) {
			        var id = row.id;
			        var actions = [];
			        actions.push('<a class="btn btn-success btn-xs"  href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
			        return actions.join('');
			    }
			}]
  };
$(function(){
	var oTab=$.table.oTableInit(options);
	oTab.Init();
})
</script>

</body>


</html>
